package com.mlog.njyjy.ndop.monitor.collector;

import com.mlog.njyjy.ndop.monitor.collector.dao.TaskRepository;
import com.mlog.njyjy.ndop.monitor.collector.factory.ScanRouteFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication(scanBasePackages = {"com.mlog.njyjy"})
@EnableSwagger2
@EnableScheduling
public class CollectorApp {
    public static void main(String[] args) {
        SpringApplication.run(CollectorApp.class, args);
    }

    @Bean(initMethod = "init")
    public ScanRouteFactory scanRouteFactory(TaskRepository taskRepository) {
        return new ScanRouteFactory(taskRepository);
    }
}
